platform:ios, '10.0'
#use_frameworks!
source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/aliyun/aliyun-specs.git'

# 飞燕
def livingLink_v9
  pod 'IMSApiClient', '1.6.9'
  pod 'IMSAuthentication', '1.4.3'
  pod 'IMSIotSmart', '1.2.6'
  pod 'AlicloudSecurityGuardSDK', '5.5.51'
  pod 'AlicloudSGSecurityBody', '5.5.60'
  pod 'AlicloudSGMain', '5.5.51'
  pod 'AlicloudALBBOpenAccount', '3.4.0.54'
  pod 'IMSThingCapability', '1.8.10'
  pod 'IMSMobileChannel', '1.6.12'
  pod 'IMSBoneKit', '1.3.11.11'
  pod 'AKReactNative', '0.59.9.2'
  pod 'MJRefresh', '3.1.15'
  pod 'ZipArchive', '1.4.0'
  pod 'IMSReactNativeExtension', '1.0.2'
  pod 'IMSDeviceCenter', '1.12.9'
  pod 'CocoaAsyncSocket', '7.4.2'
  pod 'Reachability', '3.2'
  pod 'IMSBreezeSDK', '1.7.4'
  pod 'IMSOtaBusinessSdk', '1.6.3'
  pod 'IMSDeviceGateway', '1.6.8'
end

def livingLink_old
  pod 'IMSLaunchKit', :path => './IMSLaunchKit'
  pod 'IMSLocalizeLaunch', :path => 'LaunchPods/IMSLocalizeLaunch.podspec'
  pod 'IMSLivingLaunch', :path => 'LaunchPods/IMSLivingLaunch.podspec'
  # log
  pod 'IMSLogLaunch', :path => 'LaunchPods/IMSLogLaunch.podspec'
  pod 'IMSApiClientLaunch', :path => 'LaunchPods/IMSApiClientLaunch.podspec'
#  pod 'IMSOpenAccountUILaunch', :path => 'LaunchPods/IMSOpenAccountUILaunch.podspec'
  # 长连接
  pod 'IMSMobileChannelLaunch', :path => 'LaunchPods/IMSMobileChannelLaunch.podspec'
  # 插件
  pod 'IMSBoneKitLaunch', :path => 'LaunchPods/IMSBoneKitLaunch.podspec'
  pod 'IMSOpsTools', '1.0.4'
  # 物
  pod 'IMSThingCapabilityLaunch', :path => 'LaunchPods/IMSThingCapabilityLaunch.podspec'
  # 蓝牙
  # bussiness
  pod 'IMSDomain', :path=>'./IMSDomain'
  pod 'IMSOpenAccountBase', :path=>'./IMSOpenAccountBase'
  pod 'IMSLivingLink', :path=>'./IMSLivingLink'
  pod 'IMSMessage', :path=>'./IMSMessage'
  pod 'IMSSmartSpeakerAccess', :path=>'./IMSSmartSpeakerAccess'
  pod 'IMSWidget', :path=>'./IMSWidget'
  # tool
  pod 'IMSHorizPickerView', :path=>'./IMSHorizPickerView'
  pod 'IMSRefresh', :path=>'./IMSRefresh'
  pod 'IMSLocalize', :path=>'./IMSLocalize'
  pod 'IMSCategory', :path=>'./IMSCategory'
  pod 'IMSSegmentedControl', :path=>'./IMSSegmentedControl'
  pod 'IMSLivingAppClient', :path=>'./IMSLivingAppClient'
  pod 'IMSScanner', :path=>'./IMSScanner'
  pod 'IMSKVO', :path=>'./IMSKVO'
  # 音乐律动
  pod 'IMSMusicRhythm', :path=>'./IMSMusicRhythm'
  pod 'IMSMusicRhythmBone', :path=>'./IMSMusicRhythmBone'
  pod 'IMSAudioRhythem',  :path=>'./IMSAudioRhythem'
  pod 'IMSPageComponent', :path=>'./IMSPageComponent'
  pod 'IMSCircleGradientView', :path=>'./IMSCircleGradientView'
  pod 'IMSTickView', :path=>'./IMSTickView'
  pod 'IMSUIKit', :path=>'./IMSUIKit'
  # qrcode 配网
  pod 'IMSDevCenterNative', :path => './IMSDevCenterNative'
  pod 'IMSLocalOTA', :path => './IMSLocalOTA'
  pod 'IMSLocalBLEOTA', :path => './IMSLocalBLEOTA'
  pod 'IMSUITheme', :path => './IMSUITheme'
end

def local
  pod 'ATMAnalytics', :path=>'./ATMAnalytics'
  pod 'UT_Core', :path=>'./UT_Core'
  pod 'UT_Common',:path=>'./UT_Common'
  # 配网
  # 推送 专有云
#  pod 'CocoaAsyncSocket', :path=>'./CocoaAsyncSocket'
#  pod  'AliEMASConfigure',  :path=>'./AliEMASConfigure'
#  pod  'AliNetStateInterface', :path=>'./AliNetStateInterface'
#  pod  'TBAccsSDK',         :path=>'./TBAccsSDK'
#  pod  'NetworkSDK',       :path=>'./NetworkSDK'
#  pod  'Tnet', :path => './Tnet'
pod 'SDWebImage'
#  pod 'SDWebImage', :path=>'./SDWebImage'
#  pod 'AliUserTrackInterface', :path=>'./AliUserTrackInterface'
#  pod 'AliRemoteDebugInterface', :path=>'./AliRemoteDebugInterface'
#  pod 'AliUTDIDInterface', :path=>'./AliUTDIDInterface'
  pod 'WebP', :path=>'./WebP'
  pod 'MeshSDK', :path=>'./MeshSDK'
  pod 'RCTBLEMesh', :path=>'./RCTBLEMesh'
  pod 'RadialHueControl', :path=>'./RadialHueControl'
  pod 'AutomaticalRules', :path=>'./AutomaticalRules'
  pod 'ILopAPIManager', :path=>'./ILopAPIManager'
  pod 'MXBridge', :path => './MXBridge'
  pod 'MXAPIManger', :path => './MXAPIManger'
  pod 'MXMusicRhythm', :path => './MXMusicRhythm'

end

def third
  # Facebook 依赖
  pod 'GoogleSignIn', '4.0.2'
  pod 'AlicloudUtils', '1.3.2'
##  # 专有云推送 new
  pod 'AlicloudPushIoT', '1.9.5.5-noccp'
  pod 'IMSPCloudPush', '1.0.2'
  pod 'IMSPCloudNetwork', '1.0.0'
  #  # 专有云推送 old
  #  pod 'AlicloudPushIoT', '1.9.5.5'
  #  pod  'PushCenterSDK',     :path=>'./PushCenterSDK'
  #  pod 'IMSAlicloudPushIoTLaunch', :path => 'LaunchPods/IMSAlicloudPushIoTLaunch.podspec'
# 蓝牙 Mesh SDK
  pod 'nRFMeshProvision', :git => 'https://github.com/wzbdroid0212/nRFMeshProvision.git',:commit => '4c1d10bc7e4c91d78ecc545885d17f9b3b6855a2'
#pod 'nRFMeshProvision', '2.2.1'
  
  pod 'mob_pushsdk'
  pod 'AliyunOSSiOS'
  pod 'Bugly'
  pod 'mob_sharesdk'
  pod 'mob_sharesdk/ShareSDKPlatforms/QQ'
  pod 'mob_sharesdk/ShareSDKPlatforms/WeChat'
  pod 'YYText'
  pod 'BEMCheckBox'
end


def collection
  livingLink_v9
end



target "ObjectCDemo" do
  collection
end

post_install do |installer|
    installer.aggregate_targets.each do |target|
      
        copy_pods_resources_path = "Pods/Target Support Files/#{target.name}/#{target.name}-resources.sh"
        string_to_replace = '--compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"'
        assets_compile_with_app_icon_arguments = '--compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${BUILD_DIR}/assetcatalog_generated_info.plist"'
        text = File.read(copy_pods_resources_path)
        new_contents = text.gsub(string_to_replace, assets_compile_with_app_icon_arguments)
        File.open(copy_pods_resources_path, "w") {|file| file.puts new_contents }
    end
    installer.pods_project.targets.each do |target|
        if target.name == 'Pods-MXCHIP'
            target.build_configurations.each do |config|
                config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
                config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'MXCHIP_1'
#                puts "===================>target build configure #{config.build_settings}"
            end
        end

        target.build_configurations.each do |config|
            config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'No'
            config.build_settings['CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES'] = 'YES'
        end
    end
end
